<!DOCTYPE html>
 <html>
 <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0'/>
    <title>微信安全支付</title>
     <link rel="stylesheet" href="__ROOT__/Apps/WebApp/View/default/AmazeUI/assets/css/amazeui.min.css">
     <link rel="stylesheet" href="__ROOT__/Apps/WebApp/View/default/css/common.css?v={$WST_V}">
     <link rel="stylesheet" href="__ROOT__/Apps/WebApp/View/default/css/wst_page_common.css?v={$WST_V}">
     <link rel="stylesheet" href="__ROOT__/Apps/WebApp/View/default/css/orders_management.css?v={$WST_V}">
     <!--<link rel="stylesheet" href="__ROOT__/Apps/WebApp/View/default/css/order_details.css?v={$WST_V}">-->
     <style>
         .dtitle{
             background-color: orange;
             color: white;
            height: 40px;
             line-height: 40px;
             font-size: 18px;
             padding-left:25px;
         }
         .orderdetail{
             padding: 5px;
         }
         .list{
         }
         .surepay{
             width:80%;
             height:50px;
             margin-left:10%;
             background-color:orange;
             border:0px lightgreen solid;
             cursor: pointer;
             color:white;
             font-size:20px;
             border-radius: 5px;
         }
         .tac{

         }
     </style>
    <script type="text/javascript">
        //调用微信JS api 支付
        function jsApiCall()
        {
            WeixinJSBridge.invoke(
                'getBrandWCPayRequest',
                <?php echo $jsApiParameters; ?>,
                function(res){
//					alert(JSON.stringify(res));
//                    alert(res.err_msg)
//                    WeixinJSBridge.log(res.err_msg);
                    if(res.err_msg == "get_brand_wcpay_request:ok"){
//                        alert(1)
                       /*这里写如果支付成功的话执行什么操作*/
//						alert('支付成功'+JSON.stringify(res));
                        wstMsg('下单成功');
                        setTimeout(function(){
                            location.href = WST.U('WebApp/Orders/index');
                        }, 500);
                        storageRemoveItem('orderInfo');
                    }else{
                        //返回跳转到订单详情页面
                        alert('支付失败');

                    }
                }
            );
        }
        function callpay()
        {
            if (typeof WeixinJSBridge == "undefined"){
                if( document.addEventListener ){
                    document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
                }else if (document.attachEvent){
                    document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                    document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
                }
            }else{
                jsApiCall();
            }
        }

    </script>
 </head>
 <body>
<div>
    <header class="wst-nav">
        <div class="am-g">
            <div class="am-u-sm-2">
                <a href="{:U('WebApp/Users/index')}" class="wst-header-left"><i class="am-icon-angle-left am-icon-sm"></i></a>
            </div>
            <div class="am-u-sm-8 wst-nav-center">
                <span class="wst-header-center"> 支付信息</span>
            </div>
            <div class="am-u-sm-2">&nbsp;</div>
        </div>
    </header>
    <div style="padding: 20px;margin-top: 60px">

            <div class="orderdetail">
                <div style="text-align: center; height:50px;line-height:50px;font-size:2rem;margin: 5px 3%;">
                    <!--<span class="am-u-sm-4 tac">订单号：</span><span id="orderNumber" class="am-u-sm-8 tac">{$orderIds}</span>-->
                    商品购买
                </div>
                <div style="text-align: center; height:60px;line-height:60px;margin: 5px 3%;">
                    <span style="font-size:4rem;">￥</span><span id="orderPrice" style="color: orange;font-size:9rem;text-align: center">{$totalMoney}</span><span style="font-size: 2rem">元</span>
                </div>
            </div>

    </div>

<div style="margin-top:30px">
    <button class="surepay" type="button" onclick="jsApiCall()" id="asd" >微信支付</button>
</div>


    </div>
<div class="am-g wst-msg-modal" id="wst-msg-modal">
    <div class="wst-modal-content" id="wst-modal-content"></div>
</div>
<div class="wst-to-top" id="toTop">
    <i class="am-icon-arrow-up wst-to-top-icon"></i>
</div>
<include file="./Apps/WebApp/View/default/common_js.html"/>
 </body>
 </html>